// Component/dialog/dialog.js
Component({
  options: {
    styleIsolation: 'shared'
  },
  /**
   * 组件的属性列表
   */
  properties: {
    maskClosable: {
      type: Boolean,
      value: true,
    },
    type: {
      type: "middle" | "bottom",
      value: "middle",
    },
    show: {
      type: Boolean,
      default: false
    },
    diClass: {
      type: String,
      default: ""
    },
    diStyle: {
      type: String,
      default: ""
    },
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    close() {
      // this.triggerEvent('trigger')
      if (!this.data.show) return;
      this.setData({
        show: false,
      })
      this.triggerEvent('close')
    }
  }
})
